#include "file.h"
#include "stdio.h"

int read() {
    printf("console中的read被调用了\n");
    return 1;
}

void write(char c) {
    printf("console中的write被调用了\n");
}

int mm_read() {
    printf("mm中的read被调用了\n");
}

void mm_write(char c) {
    printf("mm中的write被调用了\n");
}

struct MYFILE m_console = {read, write};
struct MYFILE mm_console = {mm_read, mm_write};

struct MYFILE *ASTDIN;
void init_it(int tag) {
    if (tag < 0) {
         ASTDIN = &m_console;
    }else{
         ASTDIN = &mm_console;
    }
}
